package com.zxk.core.common.model;


import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author zxk
 * @description 新闻
 * @date 2020/8/28
 */
public class News {

    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    private String title;

    private String detailLink;

    private String content;

    @JSONField(format = "yyyy-MM-dd hh:mm:ss")
    private Date newsTime;

    private String source;

    private String author;

    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @JSONField(format = "yyyy-MM-dd hh:mm:ss")
    private Date createTime;

    @JSONField(format = "yyyy-MM-dd hh:mm:ss")
    private Date updateTime;

    @TableLogic //逻辑删除
    private Integer deleted;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDetailLink() {
        return detailLink;
    }

    public void setDetailLink(String detailLink) {
        this.detailLink = detailLink;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getNewsTime() {
        return newsTime;
    }

    public void setNewsTime(Date newsTime) {
        this.newsTime = newsTime;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }


    @Override
    public String toString() {
        return  "News{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", detailLink='" + detailLink + '\'' +
                ", content='" + content + '\'' +
                ", newsTime=" + newsTime +
                ", source='" + source + '\'' +
                ", author='" + author + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", deleted=" + deleted +
                '}';
    }
}
